#!/usr/bin/env python
# coding=utf-8
# __author__ = 'Yunchao Ling'

import sys

name1=sys.argv[1]
name2=name1.split(".")[0]
infile=open(name1,"r")
count=1
outfile=open(name2+"_"+str(count)+".txt","w")

line_count=0
for line in infile:
    line=line.rstrip()
    outfile.write(line+"\n")
    outfile.flush()
    line_count+=1
    if line_count==20000000:
        outfile.close()
        line_count=0
        count+=1
        outfile=open(name2+"_"+str(count)+".txt","w")
infile.close()
outfile.close()